<template>
  <h1>{{num}}</h1>
  <button @click="btn">修改</button>
</template>

<script setup>
const props = defineProps({
  num: {
    type: String
  }
})
const emit = defineEmits(['update:num'])
const btn = () => {
  console.log(props.num);
  emit('update:num', 200)
  // props.num = 200
}
</script>

<style >
</style>